﻿<!-- saved from url=(0014)about:internet -->
<!doctype html lang="en">
<!-- 
Smart developers always View Source. 

This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR. 

Learn more about Flex at http://flex.org 
// -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta id="IE9CompatibilityMeta" runat="server" http-equiv="X-UA-Compatible" content="IE=9" />
    <script src='/cwcare/DesktopModules/cwcareXML/GoogleMap/js/jquery.min.js' type='text/javascript'></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="/cwcare/DesktopModules/cwcareXML/GoogleMap/js/loadXML.js"></script>
    <script type="text/javascript">
        function gup(name) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(window.location.href);
            if (results == null)
                return "";
            else
                return results[1];
        }
        function getLattitude() {
            return [gup("lattitude"), gup("longitude")];
        }
    </script>
    <script type="text/javascript">
        xmlDoc = loadXMLDoc("/DesktopModules/cwcareXML/GoogleMap/markers.xml");
        x = xmlDoc.getElementsByTagName('marker');
        var sites = Array();
        
        for (i = 0; i < x.length; i++) {
            var arr = Array();
            if (x[i].getAttribute('city').trim() == decodeURI(gup("city").trim())) {
                arr.push(x[i].getAttribute('name'), x[i].getAttribute('lat'), x[i].getAttribute('lng'), x[i].getAttribute('telephone'), x[i].getAttribute('address'), x[i].getAttribute('addressID'));
                sites.push(arr);
            }
        }
        //	alert(sites.length);
        /*var sites = [
        ['Medical Center', 39.390604,-76.613215, 4, '7505 Osler Drive, Suite 402 Towson, MD,  21204'],
        ['1400 Forest Glen Road, Suite 525', 39.016132,-77.032859, 4, '1400 Forest Glen Road, Suite 525, Silver Spring, MD, 20910'],
        ['10313 Georgia Avenue, Suite 202', 39.023797,-77.045600, 4, '10313 Georgia Avenue, Suite 202, Silver Spring, MD, 20902'],
        ['10215 Fernwood Rd., Suite 101', 39.022320,-77.134993, 2, '10215 Fernwood Rd., Suite 101, Bethesda, MD, 20817'],	
        ['61 Thomas Johnson Drive', 39.446851,-77.405479, 4, '61 Thomas Johnson Drive, Frederick, MD, 21702'],
        ['10313 Georgia Avenue, Suite 202', 39.023797,-77.045600, 4, '10313 Georgia Avenue, Suite 202, Silver Spring, MD, 20902'],
        ['Mount Evans', 39.104509,-77.190503, 4, 'This is Mount Evans.'],
        ['Irving Homestead', 39.365474,-77.165813, 2, 'This is the ,Irving Homestead.'],	
        ['Badlands, National Park', 39.032894,-77.003135, 1, 'This is Badlands National Park'],
        ['Flatirons in the Spring', 39.023593,-77.045532, 3, 'These are the Flatirons in the spring.'],	
        ['Mount Evans', 38.89037,-77.031959, 9, 'This is Mount Evans.'],
        ['Irving Homestead', 39.21164,-76.940174, 10, 'This is the ,Irving Homestead.']
        ];*/

        var infowindow = null;
        $(document).ready(function () { initialize(); });

        function initialize() {

            var lattitude = getLattitude();
            var centerMap = new google.maps.LatLng(lattitude[0], lattitude[1]);

            var myOptions = {
                zoom: 10,
                center: centerMap,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            }

            var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

            setMarkers(map, sites);
            infowindow = new google.maps.InfoWindow({
                content: "loading..."
            });

            var bikeLayer = new google.maps.BicyclingLayer();
            bikeLayer.setMap(map);
        }




        function setMarkers(map, markers) {

            for (var i = 0; i < markers.length; i++) {
                var sites = markers[i];
                //alert(sites[1]+";"+ sites[2]);
                var siteLatLng = new google.maps.LatLng(sites[1], sites[2]);
                var marker = new google.maps.Marker({
                    position: siteLatLng,
                    map: map,
                    title: sites[0],
                    html: sites[4],
                    tele: sites[3],
                    addressId: sites[5]
                });

                var contentString = "Some content";

                google.maps.event.addListener(marker, "click", function () {
                    infowindow.setContent("<div align='left' style='width:300px'><img src='/cwcare/portals/_default/skins/cwcare_newskin/images/logo.png'/><br/>" + "<a href='../../../Provider.aspx?addid="  + this.addressId + "'" + " target='_parent'>" + this.html + "</a>" + "<br />" + this.tele + "</div>");
                    infowindow.open(map, this);
                });
            }
        }
    </script>
</head>
<body>
 <script type="text/javascript">
     function ReloadMap() {
         var f = document.getElementById("map_canvas");
         if (f != null)
             f.src = f.src;
     }
     $(document).ready(function () { ReloadMap(); });
</script> 
    <div id="map_canvas" style="width: 510px; height: 580px;">
    </div>
   
</body>
</html>
